package Level02_six;

import java.util.Iterator;
import java.util.LinkedHashSet;
import java.util.Scanner;

public class Test {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        System.out.println("随便输入");
        String str = scanner.nextLine();
        LinkedHashSet<Object> objectLinkedHashSet = new LinkedHashSet<>();
        //把字符串转化为char
        char[] chars = str.toCharArray();
        for (char aChar : chars) {
            objectLinkedHashSet.add(aChar);
        }
        System.out.println(objectLinkedHashSet);
        Iterator<Object> iterator = objectLinkedHashSet.iterator();
        while (iterator.hasNext()) {
            System.out.print(iterator.next());
        }

    }
}
